{{#authMethods}}
{{#isApiKey}}
{{^isKeyInCookie}}
	if r.ctx != nil {
		// API Key Authentication
		if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
			if apiKey, ok := auth["{{name}}"]; ok {
				var key string
				if apiKey.Prefix != "" {
					key = apiKey.Prefix + apiKey.Key
				} else {
					key = apiKey.Key
				}
				{{#isKeyInHeader}}
				localVarHeaderParams["{{keyParamName}}"] = key
				{{/isKeyInHeader}}
				{{#isKeyInQuery}}
				localVarQueryParams.Add("{{keyParamName}}", key)
				{{/isKeyInQuery}}
			}
		}
	}
{{/isKeyInCookie}}
{{/isApiKey}}
{{/authMethods}}